<template>
    <child @getData="getDatas"></child>
    <h1 v-if="sonData">接收到子组件的值：{{ sonData }}</h1>
    <!-- {{ zuDatas }} -->
    {{ sonDatas }}
</template>
<script setup>
import child from './child.vue'
import { ref, defineExpose, provide, inject } from 'vue';
const sonData = ref('')
function getDatas(data) {
    console.log(data, 7)
    sonData.value = data
}
defineExpose({
    getDatas,
})
const sonDatas = inject('sonDatas')
provide('zuDatas', '11')
</script>